﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.Configuration.Install;
using System.Linq;
using System.Text;
using System.ServiceProcess;

namespace BilingualSentSearchHost
{
    [RunInstaller(true)]
    public partial class BilingualSentSearchHostInstaller : Installer
    {
        public BilingualSentSearchHostInstaller()
        {
            InitializeComponent();

            Console.WriteLine("Please setting the service's name:");
            string strServiceName = Console.ReadLine();

            ServiceProcessInstaller processInstaller = new ServiceProcessInstaller();
            ServiceInstaller serviceInstaller = new ServiceInstaller();

            processInstaller.Account = ServiceAccount.LocalSystem;
            processInstaller.Username = "";
            processInstaller.Password = "";

            serviceInstaller.DisplayName = "BilingualSentSearch Service - " + strServiceName;
            serviceInstaller.Description = "BilingualSentSearch Service - " + strServiceName;
            serviceInstaller.ServiceName = "BilingualSentSearch Service - " + strServiceName;
            serviceInstaller.StartType = ServiceStartMode.Automatic;

            Installers.Add(processInstaller);
            Installers.Add(serviceInstaller);
        }
    }
}
